package pri.abner.practice.thread.threadImpl;
/**
 * @description 
 * @author  Abner Chow
 * @date Created in 2018/11/13 15:41
 * @version v1.0.0
 */
public class ThreadA extends Thread {

    @Override
    public void run() {
        System.out.println(Thread.currentThread().getName() + "获取到CPU资源");
        try{
            Thread.sleep(1000);
        }catch (InterruptedException e){
            System.out.println(e.toString());
        }
        for (int i = 0; i < 100; i++) {
            System.out.println( Thread.currentThread().getName() +  "通过继承的方式实现,遍历：" + i );
        }
        super.run();
    }

    public ThreadA(String name){
        super(name);
    }

}
